package nl.gamayun.whohasit;

import java.util.Calendar;

import nl.gamayun.whohasit.Loan;
import nl.gamayun.whohasit.TYPE;
import android.test.AndroidTestCase;

public class LoanTest extends AndroidTestCase {

	private Loan loanFrom;
	private Loan loanTo;
	private String header = "header";
	private String detail = "detail";
	private String loanerName = "loanerName";
	
	@Override
	protected void setUp() throws Exception
	{
		super.setUp();
		Calendar returnDate = Calendar.getInstance();
		returnDate.add(Calendar.WEEK_OF_YEAR, 4);
		loanFrom = new Loan(returnDate, header, detail, 0L, loanerName, TYPE.lent_from);
		loanTo = new Loan(returnDate, header, detail, 0l, loanerName, TYPE.lent_to);
	}

	public void testLoanFromIsTypeFrom()
	{
		assertTrue(loanFrom.getType().equals(TYPE.lent_from));
	}
	
	public void testLoanFromIsTypeTo()
	{
		assertEquals(true, loanTo.getType().equals(TYPE.lent_to));
	}
}
